Extended BASIC 2.9 G.E.M. Technical Reference Card

This reference covers the Graphics Enhancement Module (G.E.M.) routines for TI Extended BASIC 2.9. It is designed for use by developers and AI agents to utilize the expanded capabilities of this version.

Core System & Utility CALLs
CALL BEEP: Sounds the system accept tone.
CALL BYE: Returns to the title screen from a running program.
CALL CAT("devicename."): Displays a disk catalog for the specified device. The pathname must end with a period (e.g., "DSK1.").
CALL CHIME: Generates a chime sound effect.
CALL CLSALL: Closes all currently open files.
CALL CRASH: Generates a crash sound effect.
CALL HELP: Displays a multi-page help menu including new calls, color tables, character sets, and a number converter.
CALL HONK: Generates the system error tone.
CALL NYANYA: Generates a "nyanya" sound effect.
CALL QUIT: Returns to the title screen; functional equivalent to CALL BYE.
CALL QUITOF: Disables the QUIT key (FCTN =).
CALL QUITON: Re-enables the QUIT key function.
CALL VERSION(X): Returns the version number and build date into variable X (e.g., 2.920240206).
CALL WAIT(duration): Pauses execution. 60 units equals approximately one second.

Enhanced Graphics & Character Management
CALL CHAR(char_code, pattern_string): Supports characters 30159. Patterns can be up to 255 bytes (up to 16 characters in one call).
CALL CHARPAT(char_code, string_var): Returns the 16-character hex pattern for characters 30159.
CALL COLOR(ALL, foreground, background): Sets colors for all characters from 30 to 143. Also allows defining colors for sets 0-31.
CALL FONT(number): Loads one of 60 built-in fonts (affects ASCII 30127).
CALL LFONT(filename): Loads a font pattern file from disk.
CALL SFONT(filename): Saves current character patterns (32127) to disk in memory image format.
CALL SPROF: Stops motion of all sprites.
CALL SPRON: Restarts motion of all sprites.
CALL SCREENOF: Turns off the video display (blank screen).
CALL SCREENON: Turns on the video display.

Program Execution & Chaining
CALL RUN(filename): Runs an XB program from within a running program. Unlike standard XB, the filename can be a string variable. Resets variables (prescan).
CALL RUNL1(filename): Chains to another program (must be IV254 format) and starts at the first line. Crucially, it preserves variables and skips the prescan.
CALL SAVEIV("filename"): Forces the current program to save in Internal Variable 254 format. Essential for large programs or those using RUNL1.
CALL DV2XB(filename): Merges a DV80/TXT file into memory or processes it as a batch file for the line editor.

Memory, Hardware & Loading
CALL INITG: Performs standard INIT, loads GPLLNK and DSRLNK support, and clears the interrupt hook.
CALL LOAD(filename): Uses a high-speed assembly loader (20x faster than standard XB). Supports compressed code and REFs.
CALL MLOAD("filename", mode): Loads an E/A Option 5 program image. If mode=1, the program runs immediately.
CALL MSAVE("filename", start, length): Saves a memory range in program image format.
CALL PEEKG(addr, var): Reads values from GROM.
CALL PEEKV(addr, var): Reads values from VDP RAM.
CALL POKEV(addr, val): Writes values to VDP RAM.
CALL MOVE(mode, start, target, length): Block move memory. Modes: 1 (VDP-VDP), 2 (VDP-CPU), 3 (CPU-VDP), 4 (CPU-CPU).
CALL LDCR(bits, addr, val): Loads 116 bits into the CRU.
CALL STCR(bits, addr, var): Reads 116 bits from the CRU into a variable.

Graphics Environment Selection

These calls switch the system mode and optionally set CALL FILES(n).
CALL XB(n): Standard Extended BASIC.
CALL XB256(n): Enables 256 characters and dual-screen support.
CALL T40XB(n): Enables 40-column text mode.
CALL T80XB(n): Enables 80-column text mode.
CALL TML(c, n): Enables "The Missing Link" bit-mapped mode (c=1: 16 colors, c=2: 2 colors).
CALL MULTI(n): Enables Multicolor mode (64x48 pixels).
CALL XXB(n): Standard XB plus Barry Traver's XXB 1.5 extensions.

Disk & Editor Utilities
CALL SSSD / DSSD / DSDD / DSQD: Formats disks in various densities (controller dependent).
CALL EDIT32 / EDIT40 / EDIT80: Selects the editor mode (Standard, 40-column, or 80-column).
CALL FC: Starts "Force Command" (requires TIPI).
CALL DM1000: Runs Disk Manager 1000 (real hardware).
